//
//  ActivityIndicator.swift
//  JiaoZiTaxi
//
//  Created by Hu Gang on 2022/10/12.
//

import Foundation
import SwiftUI

struct ActivityIndicator: UIViewRepresentable {
  let style: UIActivityIndicatorView.Style

  func makeUIView(context: Context) -> UIActivityIndicatorView {
    return UIActivityIndicatorView(style: style)
  }

  func updateUIView(_ uiView: UIActivityIndicatorView, context: Context) {
    uiView.startAnimating()
  }
}

struct ActivityIndicator_Previews: PreviewProvider {
  static var previews: some View {
    ActivityIndicator(style: .medium)
  }
}
